export default function(sequelize, DataTypes) {
  return sequelize.define('group_base_info', {
    _session_id: {
      type: DataTypes.STRING(25),
      allowNull: false,
      primaryKey: true
    },
    _name: {
      type: DataTypes.STRING(25),
      allowNull: true
    },
    _avatar: {
      type: DataTypes.STRING(25),
      allowNull: true
    },
    _birth: {
      type: DataTypes.STRING(25),
      allowNull: true
    },
    _group_account: {
      type: DataTypes.STRING(25),
      allowNull: false,
      primaryKey: true
    },
    _leader: {
      type: DataTypes.STRING(25),
      allowNull: false
    },
    _update_time: {
      type: DataTypes.STRING(15),
      allowNull: false,
      comment: "用户数据更新时间"
    }
  }, {
    sequelize,
    tableName: 'group_base_info',
    timestamps: false,
    indexes: [
      {
        name: "PRIMARY",
        unique: true,
        using: "BTREE",
        fields: [
          { name: "_session_id" },
          { name: "_group_account" },
        ]
      },
      {
        name: "u_account",
        unique: true,
        using: "BTREE",
        fields: [
          { name: "_group_account" },
        ]
      },
      {
        name: "u_session_id",
        unique: true,
        using: "BTREE",
        fields: [
          { name: "_session_id" },
        ]
      },
    ]
  });
};
